package fzdy.entity;

import lombok.Data;

import javax.persistence.*;

/**
 * 消防设备信息
 */
@Entity
@Table(name = "device_info")
@Data
public class DeviceInfo {

    /**
     *设备编号
     */
    @Id
    @Column(name = "sn")
    private String sn;

    /**
     *设备名称
     */
    @Column(name = "device_name")
    private String deviceName;

    /**
     *设备类型
     */
    @Column(name = "device_type_id")
    private Integer deviceTypeId;

    /**
     *厂家
     */
    @Column(name = "manufacturer")
    private String manufacturer;

    /**
     *位置
     */
    @Column(name = "location")
    private String location;
    /**
     *经度
     */
    @Column(name = "lng")
    private String lng;

    /**
     *纬度
     */
    @Column(name = "lat")
    private String lat;

    /**
     *所属业主单位
     */
    @Column(name = "proprietor_unit_id")
    private Integer proprietorUnitId;

    /**
     *当前状态
     */
    @Column(name = "status")
    private Integer status;

    /**
     *所属售后服务单位
     */
    @Column(name = "after_sale_service_unit_id")
    private Integer afterSaleServiceUnitId;

    @ManyToOne
    @JoinColumn(name = "proprietor_unit_id", referencedColumnName = "id", foreignKey = @ForeignKey(name = "device_info_ibfk_2"),
            insertable = false, updatable = false)
    private ProprietorUnit proprietorUnit;

    @ManyToOne
    @JoinColumn(name = "device_type_id", referencedColumnName = "id", foreignKey = @ForeignKey(name = "device_info_ibfk_1"),
            insertable = false, updatable = false)
    private DeviceType deviceType;
}
